<template>
	<view class="tpl-index with-navbar">
		<view class="search-box">
			<input type="search" value="" placeholder="输入关键词来搜索" />
			<view class="btn">搜索</view>
		</view>

		<swiper class="swiper">
			<swiper-item v-for="(one, index) of banners">
				<image
					previous-margin="20upx"
					next-margin="20upx"
					class="banner"
					:src="one"
					mode="widthFix"
				></image>
			</swiper-item>
		</swiper>

		<view class="menu">
			<navigator :url="one.url" class="one" v-for="(one, index) of menu">
				<!-- <image class="image" :src="one.image" mode=""></image> -->
				<view class="icon-box"><text class="iconfont " :class="[one.icon]"></text></view>
				<text class="text">{{ one.name }}</text>
			</navigator>
		</view>
		<view class="menu menu2">
			<navigator :url="one.url" class="one" v-for="(one, index) of menu2">
				<!-- <image class="image" :src="one.image" mode=""></image> -->
				<view class="icon-box"><text class="iconfont " :class="[one.icon]"></text></view>
				<text class="text">{{ one.name }}</text>
			</navigator>
		</view>

		<view class="ul with-li-cards with-have-no-mt with-have-no-click-bg">
			<view class="title-box">
				<view class="title">卡片列表</view>
				<text class="iconfont icon-right"></text>
			</view>
			<view class="li-cards">
				<view class="li-box" v-for="one of 10">
					<view class="li">
						<image
							src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1549885995951&di=0b5aedacabf55fbcff2b1874f385b500&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fblog%2F201501%2F10%2F20150110090554_yFmSe.jpeg"
							class="icon"
							mode="aspectFill"
						></image>
						<view class="name">不带点击效果的列表</view>
					</view>
				</view>
			</view>
		</view>

		<view class="ul with-li-big-cards with-have-no-mt with-have-no-click-bg">
			<view class="title-box">
				<view class="title">卡片列表</view>
				<text class="iconfont icon-right"></text>
			</view>
			<view class="li-cards">
				<view class="li-box" v-for="one of 10">
					<view class="li">
						<image
							src="http://face.amyun.cn:80/facebook/userfiles/1/images/advertisingimgs/advertisingImgs/2018/09/mfzm3_banner.jpg"
							class="icon"
							mode="widthFix"
						></image>
						<view class="name">不带点击效果的列表</view>
						<view class="sub-name">不带点击效果的列表</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			menu2: [
				{
					name: '朋友',
					image: 'http://face.amyun.cn/static/img/nav1.f7f6345.png',
					icon: 'icon-team',
					url: '../tpl-friends/tpl-friends'
				},
				{
					name: '帮助',
					image: 'http://face.amyun.cn/static/img/nav4.d261107.png',
					icon: 'icon-question-circle'
				},
				{
					name: '钱包',
					image: 'http://face.amyun.cn/static/img/nav3.fb68282.png',
					icon: 'icon-wallet',
					url: '../tpl-wallet/tpl-wallet'
				},
				{
					name: '购物',
					image: 'http://face.amyun.cn/static/img/nav2.0ceacd3.png',
					icon: 'icon-shopping'
				}
			],
			menu: [
				{
					name: '无限卡',
					image: 'http://face.amyun.cn/static/img/nav1.f7f6345.png',
					icon: 'icon-crown',
					url: '../tpl-card/tpl-card'
				},
				{
					name: '礼物',
					image: 'http://face.amyun.cn/static/img/nav4.d261107.png',
					icon: 'icon-gift'
				},
				{
					name: '下载中心',
					image: 'http://face.amyun.cn/static/img/nav3.fb68282.png',
					icon: 'icon-cloud-download'
				},
				{
					name: '举报',
					image: 'http://face.amyun.cn/static/img/nav2.0ceacd3.png',
					icon: 'icon-alert'
				}
			],
			banners: [
				'http://face.amyun.cn:80/facebook/userfiles/1/images/advertisingimgs/advertisingImgs/2018/09/mfzm1_banner.jpg',
				'http://face.amyun.cn:80/facebook/userfiles/1/images/advertisingimgs/advertisingImgs/2018/09/mfzm1_banner.jpg'
			]
		};
	}
};
</script>

<style lang="scss">
.tpl-index {
	// padding-top:calc(100upx + var(--status-bar-height)) ;
// 	padding-top: var(--status-bar-height);
// 	margin-top: 100upx;
	background-color: #FFF;
	.menu {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding: 0 30upx;

		&.menu2 {
			.one {
				margin-bottom: 20upx;
				&:nth-child(1) {
					.icon-box {
						background-color: rgb(250, 160, 80);
					}
				}
				&:nth-child(2) {
					.icon-box {
						background-color: rgb(100, 210, 220);
					}
				}
				&:nth-child(3) {
					.icon-box {
						background-color: rgb(20, 170, 240);
					}
				}
				&:nth-child(4) {
					.icon-box {
						background-color: rgb(94, 210, 240);
					}
				}
			}
		}
		.one {
			// 			width: 186upx;
			// 			max-width: 186upx;
			display: flex;
			flex-direction: column;
			font-size: $uni-font-size-sm;
			justify-content: center;
			align-items: center;
			margin-bottom: 36upx;

			&:nth-child(1) {
				.icon-box {
					background-color: rgb(20, 170, 240);
				}
			}
			&:nth-child(2) {
				.icon-box {
					background-color: rgb(94, 210, 240);
				}
			}
			&:nth-child(3) {
				.icon-box {
					background-color: rgb(250, 160, 80);
				}
			}
			&:nth-child(4) {
				.icon-box {
					background-color: rgb(250, 125, 130);
				}
			}

			.image {
				width: 90upx;
				height: 90upx;
				border-radius: 100upx;
				margin-bottom: 16upx;
				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
			}

			.icon-box {
				width: 90upx;
				height: 90upx;
				border-radius: 100upx;
				margin-bottom: 16upx;
				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
				display: flex;
				align-items: center;
				justify-content: center;

				text {
					font-size: 46upx;
					color: #fff;
				}
			}

			.text {
				color: #666;
			}
		}
	}
	.swiper {
		width: 710upx;
		min-height: 338upx;
		margin-left: 20upx;
		border-radius: 40upx;
		box-shadow: 0 5px 20px rgba(10, 170, 210, 0.1);
		margin-bottom: 36upx;
		.banner {
			width: 710upx;
			border-radius: 40upx;
		}
	}
	.search-box {
		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20upx;
		position: fixed;
		left: 0;
		right: 0;
		// top: var(--status-bar-height);
		top: 0;
		font-size: $uni-font-size-sm;
		z-index: 100;
		padding-top:var(--status-bar-height);
		// #ifndef APP-PLUS
		padding-top:20upx;
		// #endif
		input {
			background-color: #eee;
			flex: 1;
			border-radius: 50upx;
			padding: 0 20upx;
			height: 60upx;
			line-height: 60upx;
			display: flex;
			align-items: center;
		}

		.btn {
			margin-left: 20upx;
			height: 60upx;
			line-height: 60upx;
		}
	}
}
</style>
